<#assign module="weixin"/>

<@override name="header">
</@override>
<@override name="body">

<div class="row margin-top">
	<div class="col-md-12">
		<div class="panel panel-default">
			<div class="panel-heading">系统配置</div>
			<div class="panel-body">
				<form action="${ctx}/setting/setwx" class="form-horizontal" role="form" method="post">
					
					<!-- 微信公众号二维码 -->
					<div style="position: absolute;right:150px;top:45px;width:20%;height:40vh;border:none">
						<div style="width:80%;height:80%;border:2px dashed #10c55b;margin: 5px auto;border-radius:5px;padding:10px">
							<img id="wxQrCode_img" <#if setting.wxQrCode?? && (setting.wxQrCode?length>0)>src="${ctx}/${setting.wxQrCode?if_exists}"</#if> width="100%" height="100%" style="border-radius:5px;">
						</div>
						<p hidden="hidden">
							<input type="file" id="wechat_qr_file"/>
							<input type="text" id="wxQrCode_input" value="" name="wxQrCode"/>
						</p>
						<div onclick="wechat_qr_file.click()" style="border-radius:5px;background:#10c55b;width:80%;height:40px;line-height:40px;text-align:center;font-size:16px;color:#fff;margin:auto;cursor: pointer;">
							上传微信公众号二维码
						</div>
					</div>
					<!-- 微信公众号二维码 -->
							    
				    <div class="form-group">
				        <label class="col-sm-3 control-label"><em>*</em>微信Token：</label>
				        <div class="col-sm-5">
							<input type="text" class="form-control" name="wxToken" required value="${setting.wxToken?if_exists}">
							<span class="help-block">设置token用于绑定微信公众平台时进行验证。</span>
						</div>
				    </div>
				    <div class="form-group">
				        <label class="col-sm-3 control-label"><em>*</em>微信AppId：</label>
				        <div class="col-sm-5">
							<input type="text" class="form-control" name="wxAppId" required value="${setting.wxAppId?if_exists}">
							<span class="help-block">设置微信AppId用于创建微信菜单、获取用户信息等。</span>
						</div>
				    </div>
				    <div class="form-group">
				        <label class="col-sm-3 control-label"><em>*</em>微信AppSecret：</label>
				        <div class="col-sm-5">
							<input type="text" class="form-control" name="wxAppSecret" required value="${setting.wxAppSecret?if_exists}">
							<span class="help-block">设置微信AppSecret用于创建微信菜单、获取用户信息等。</span>
						</div>
				    </div>
				    <div class="form-group">
				        <label class="col-sm-3 control-label">微信商户号：</label>
				        <div class="col-sm-5">
							<input type="text" class="form-control" name="wxPartnerId" value="${setting.wxPartnerId?if_exists}">
							<span class="help-block">设置微信商户号。</span>
						</div>
				    </div>
				    <div class="form-group">
				        <label class="col-sm-3 control-label">微信商户号密钥：</label>
				        <div class="col-sm-5">
							<input type="text" class="form-control" name="wxPartnerKey" value="${setting.wxPartnerKey?if_exists}">
							<span class="help-block">设置微信商户号密钥。</span>
						</div>
				    </div>
				    
				    <div class="form-group">
				        <label class="col-sm-3 control-label"><em>*</em>服务器地址：</label>
				        <div class="col-sm-5">
							<input type="text" class="form-control" name="wxServer" required value="${setting.wxServer?if_exists}">
							<span class="help-block">设置服务器地址用户加载图片，必须以“/”结尾。</span>
						</div>
				    </div>
				    
				    <div class="form-group">
				        <label class="col-sm-3 control-label">商户证书：</label>
				        <div class="col-sm-5">
				        	<div class="input-group">
							  <input type="text" class="form-control" id="certUrl" value="${setting.certUrl?if_exists}" readonly>
							  <span class="input-group-btn">
						        <button class="btn btn-default" type="button" id="certFileButton">上传</button>
						        <input type="file" id="certFile" name="certFile" style="display:none;">
						      </span>
							</div>
							<span class="help-block">上传商户证书apiclient_cert.p12。</span>
						</div>
				    </div>
				    
				    <h4>微信小程序</h4>
					<hr/>

                    <!-- 微信小程序二维码 -->
                    <div style="position: absolute;right:150px;top:680px;width:20%;height:40vh;border:none">
                        <div style="width:80%;height:80%;border:2px dashed #10c55b;margin: 5px auto;border-radius:5px;padding:10px">
                            <img id="wxSmall_img" <#if setting.wxSmallQrCode?? && (setting.wxSmallQrCode?length>0)>src="${ctx}/${setting.wxSmallQrCode?if_exists}"</#if> width="100%" height="100%" style="border-radius:5px;">
                        </div>
                        <p hidden="hidden">
                            <input type="file" id="small_qr_file"/>
                            <input type="text" id="small_input" value="" name="wxSmallQrCode"/>
                        </p>
                        <div onclick="small_qr_file.click()" style="border-radius:5px;background:#10c55b;width:80%;height:40px;line-height:40px;text-align:center;font-size:16px;color:#fff;margin:auto;cursor: pointer;">
                            上传微信小程序二维码
                        </div>
                    </div>

					<div class="form-group">
				        <label class="col-sm-3 control-label"><em>*</em>微信AppId：</label>
				        <div class="col-sm-5">
							<input type="text" class="form-control" name="wxAppIdMP" value="${setting.wxAppIdMP?if_exists}">
							<span class="help-block">设置微信小程序AppId用于小程序支付等功能。</span>
						</div>
				    </div>
				    <div class="form-group">
				        <label class="col-sm-3 control-label"><em>*</em>微信AppSecret：</label>
				        <div class="col-sm-5">
							<input type="text" class="form-control" name="wxAppSecretMP" value="${setting.wxAppSecretMP?if_exists}">
							<span class="help-block">设置微信小程序AppId用于小程序支付等功能。</span>
						</div>
				    </div>
				    <div class="form-group">
				        <label class="col-sm-3 control-label">微信商户号：</label>
				        <div class="col-sm-5">
							<input type="text" class="form-control" name="wxPartnerIdMP" value="${setting.wxPartnerIdMP?if_exists}">
							<span class="help-block">设置微信商户号。</span>
						</div>
				    </div>
				    <div class="form-group">
				        <label class="col-sm-3 control-label">微信商户号密钥：</label>
				        <div class="col-sm-5">
							<input type="text" class="form-control" name="wxPartnerKeyMP" value="${setting.wxPartnerKeyMP?if_exists}">
							<span class="help-block">设置微信商户号密钥。</span>
						</div>
				    </div>
							
					<#--
				    <div class="form-group">
				        <label class="col-sm-3 control-label"><em>*</em>用户关注：</label>
				        <div class="col-sm-5">
							<textarea rows="5" cols="60" id="wxSubscribe" name="wxSubscribe">${setting.wxSubscribe?if_exists}</textarea>
							<span class="help-block">当有用户关注公众账号的时候给用户发送的消息，一般为内容为：菜单或者操作提醒。</span>
						</div>
				    </div>
				    
				    <div class="form-group">
				        <label class="col-sm-3 control-label"><em>*</em>未识别消息：</label>
				        <div class="col-sm-5">
							<textarea rows="5" cols="60" id="wxUnsubscribe" name="wxUnsubscribe">${setting.wxUnsubscribe?if_exists}</textarea>
							<span class="help-block">当用户输入无法识别的内容时给用户发送的消息。</span>
						</div>
				    </div>
				    
				    <div class="form-group">
				        <label class="col-sm-3 control-label"><em>*</em>绑定提醒：</label>
				        <div class="col-sm-5">
							<textarea rows="5" cols="60" id="wxAccountBindRequest" name="wxAccountBindRequest">${setting.wxAccountBindRequest?if_exists}</textarea>
							<span class="help-block">当有用户输入手机号码进行绑定时的操作提醒。</span>
						</div>
				    </div>
				    
				    <div class="form-group">
				        <label class="col-sm-3 control-label"><em>*</em>绑定成功：</label>
				        <div class="col-sm-5">
							<textarea rows="5" cols="60" id="wxAccountBindSuccess" name="wxAccountBindSuccess">${setting.wxAccountBindSuccess?if_exists}</textarea>
							<span class="help-block">当有用户绑定成功时发送给用户的内容。</span>
						</div>
				    </div>
				    
				    <div class="form-group">
				        <label class="col-sm-3 control-label"><em>*</em>查询提醒：</label>
				        <div class="col-sm-5">
							<textarea rows="5" cols="60" id="wxQueryDriverNoResult" name="wxQueryDriverNoResult">${setting.wxQueryDriverNoResult?if_exists}</textarea>
							<span class="help-block">当用户附近没有查询到代驾员时给用户发送的消息内容。</span>
						</div>
				    </div>
					
					<div class="form-group">
				        <label class="col-sm-3 control-label"><em>*</em>绑定提醒：</label>
				        <div class="col-sm-5">
							<textarea rows="5" cols="60" id="wxNoBindAccount" name="wxNoBindAccount">${setting.wxNoBindAccount?if_exists}</textarea>
							<span class="help-block">当用户没有绑定账号时发送的消息内容。</span>
						</div>
				    </div>
				    -->
					
				    <div class="form-group">
				        <input type="submit" class="btn btn-primary center-block" value="保存">
				    </div>
				</form>
			</div>
		</div>
	</div>
</div>
</@override>
<@override name="footer">
	<script type="text/javascript">
		<#if saveSuccess??>
			$.scojs_message("修改成功", $.scojs_message.TYPE_OK);
		</#if>
	</script>
	<script type="text/javascript" src="${ctx}/assets/js/ajaxfileupload.js"></script>
	<script type="text/javascript" src="${ctx}/assets/js/setting/setwx.js"></script>
</@override>
<@extends name="../layout.ftl"/>